<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="renderer" content="webkit">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="/static/topjui/themes/default/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="/static/topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="/static/topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/static/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="/static/plugins/layui/layui.js" charset="utf-8"></script>
</head>

</head>

<body>

<!--<table data-toggle="topjui-edatagrid"-->
<table data-toggle="topjui-datagrid"
       data-options="id:'sMsgDg',
                   reloadAfterSave:true,
                    url:'/sMsg/data',
                    saveUrl:'/sMsg/save?flag=add',
                    updateUrl:'/sMsg/save?flag=edit',
                    destroyUrl:'/sMsg/delete',
                    childGrid:{
                        param:'dicName:dicName',
                        grid:[
                            {type:'datagrid',id:'sDicDg'}
                        ]
                    }">
    <thead>
    <tr>
        <th data-options="field:'uuid',title:'UUID',checkbox:true"></th>
        <th data-options="field:'msgCde',title:'消息码',width:100,readonly:true"></th>
        <th data-options="field:'statusCode',title:'状态码',width:100,editor:{type:'textbox',options:{required:true,height:30}}"></th>
        <th data-options="field:'title',title:'提示',width:100,editor:{type:'textbox',options:{required:true,height:30}}"></th>
        <th data-options="field:'message',title:'消息内容',width:350,editor:{type:'textbox',options:{required:true,height:30}}"></th>
        <th data-options="field:'paramBlockText',title:'模块名称',sortable:true"></th>
        <th data-options="field:'paramBlock',title:'模块代码',width:100,editor:{type:'combobox',options:{height:30,panelHeight:200,
                    url:'/sDic/dics?dicName=ZB_SYS_MODULE'}}"></th>
    </tr>
    </thead>
</table>
<!-- 字典集 表格工具栏 -->
<!--<div id="sMsgDg-toolbar" class="topjui-toolbar" data-options="
       grid:{
           type:'edatagrid',
           id:'sMsgDg'
       }" style="display:none">

    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
           extend:'#sMsgDg-toolbar',
           btnCls:'topjui-btn-green',
           type:'addRow',
           iconCls:'fa fa-plus'">新增</a>

    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
       extend:'#sMsgDg-toolbar',
       btnCls:'topjui-btn-blue',
       type:'saveRow',
       iconCls:'fa fa-save'">保存</a>

    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'edatagrid',
       extend:'#sMsgDg-toolbar',
       btnCls:'topjui-btn-black',
       type:'cancelRow',
       iconCls:'fa fa-close'">取消</a>

    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'doAjax',
           extend:'#sMsgDg-toolbar',
           btnCls:'topjui-btn-red',
           iconCls:'fa fa-trash',
           confirmMsg:这会导致系统不稳定，是否确定删除勾选内容？',
           grid: {
                uncheckedMsg:'请先勾选要删除的数据',
                param:'dicName:dicName',
                updateRow:false
              },
           onClick:deleteSDicCategory">删除</a>

</div>-->


<script>
    function deleteSDicCategory() {
        var rows = $('#sMsgDg').iDatagrid('getChecked');  //getChecked 在复选框被选中的时候返回所有行。
        if (rows.length == 0) {
            return $.iMessager.alert('操作提示', '请先勾选要删除的数据！', 'messager-error'); // 未勾选的话弹出消息窗口
        }
        $.iMessager.confirm('确认提示', '会导致系统不稳定，是否确定删除勾选内容？', function (r) {
            if (r) {
                $.each(rows, function (i) {
                    var dicName = rows[i].dicName;
                    var url = '/sMsg/delete';
                    var postData = {dicName: dicName}; // 请求中携带的JSON数据
                    $.post(url, postData, function (res) {
                        if (res.statusCode == 200) { // 后台返回状态值
                            $.iMessager.show({title: '操作提示', msg: res.message, timeout: 5000, showType: 'slide'});// '消息窗口'组件
                        } else {
                            $.iMessager.show({title: '操作提示', msg: res.message, timeout: 5000, showType: 'slide'});// '消息窗口'组件
                        }
                    }, 'JSON')
                });
                window.location.reload();
                /* $("#sDicDg").iDatagrid('reload');//请求成功后刷新表格
                $("#sMsgDg").iDatagrid('reload');//请求成功后刷新表格*/
            }
        });
    }
</script>
</body>
</html>
